<?php
$dis_id=8;
include("../../inc/conn.inc");
include("../islogin.php");
if($_POST['act_xg']){
@mysql_query("update p_price set p_title='$_POST[p_title]',p_info='$_POST[p_info]',p_xinghao='$_POST[p_xinghao]',p_guige='$_POST[p_guige]',p_price='$_POST[p_price]',p_price2='$_POST[p_price2]',p_cailiao='$_POST[p_cailiao]',p_changdi='$_POST[p_changdi]',p_renzheng='$_POST[p_renzheng]' where id='".$_POST['iid']."'");

echo "<script>alert('编辑成功');location='".$_POST['urls']."';</script>";
}?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js" charset="gb2312"></script>
<script type="text/javascript" src="../js/catalog.js" charset="gb2312"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 产品价格系统 &gt;&gt; 修改产品价格</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">修改产品价格</TD>
   </TR>
</TABLE>
<br>
<?php
$rs=mysql_query("select * from p_price where id='".$_GET['xg_id']."' and member_id='".$_COOKIE['user_id']."'");
$row=mysql_fetch_array($rs);
?>
    
<TABLE width="100%" border="0" cellpadding="0" cellSpacing="1" bgcolor="#C1DCF5">
        <TBODY>
        <form method="post" action="" name="form1" onSubmit="return checkform()">
          <TR>
            <td width="17%" height="25" align="center" bgcolor="#EFF6FF">产品名称&nbsp;<font color="#FF0000">*</font></td>
            <TD width="83%" bgcolor="#F9F9F9" style="padding-left:4px;"><input name="p_title" id="p_title" type="text" size="50" maxlength="120" value="<?=$row[p_title]?>"></TD>
          </TR>		  
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">产品描述&nbsp;<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><textarea name="p_info" id="p_info" cols="70" rows="15"><?=$row[p_info]?></textarea></TD>
          </TR>
		  <TR>
            <td height="25" colspan="2" align="left" bgcolor="#EFF6FF"><STRONG>产品属性</STRONG></td>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">产品型号</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="p_xinghao" type="text" size="20" maxlength="50" value="<?=$row[p_xinghao]?>"></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">产品规格</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="p_guige" type="text" size="20" maxlength="50" value="<?=$row[p_guige]?>"></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">产品价格<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="p_price" type="text" size="20" maxlength="50" value="<?=$row[p_price]?>">
            &nbsp;<font color="#FF0000">请报单价</font></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">代理商价格<font color="#FF0000">*</font></td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="p_price2" type="text" size="20" maxlength="50" value="<?=$row[p_price2]?>">
            &nbsp;<font color="#FF0000">请报单价</font></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">产品材料</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="p_cailiao" type="text" size="20" maxlength="50" value="<?=$row[p_cailiao]?>"></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">产品产地</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="p_changdi" type="text" size="20" maxlength="50" value="<?=$row[p_changdi]?>"></TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">产品认证</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input name="p_renzheng"  type="text" size="20" maxlength="50" value="<?=$row[p_renzheng]?>">
            (如:CE认证) </TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">&nbsp;</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input type="submit" value="提交">
			<input type="hidden" name="iid" value="<?=$row['id']?>">
			<input type="hidden" name="urls" value="<?=$_SERVER['HTTP_REFERER']?>">
        <INPUT type="hidden" value="ok" name="act_xg"></TD>
          </TR>
 </form>                
</TABLE>
</div>
<div class="onl"></div>
<?php include("../inc/foot.php");
?>
</div>
</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){
   if($("p_title").value==""){
      alert("产品名称不能为空");
      $("p_title").focus();
      return false;
   }
   if($("p_info").value==""){
      alert("产品描述不能为空");
      $("p_info").focus();
      return false;
   }
    if($("p_price").value==""){
      alert("产品价格不能为空");
      $("p_price").focus();
      return false;
   }
    if($("p_price2").value==""){
      alert("代理商价格不能为空");
      $("p_price2").focus();
      return false;
   }   
}
</script>